package com.xuanwei.core.entity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xuanwei.core.enums.RefundStatus;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @Author jiangyong
 * @Description TODO
 * @Date 2019/9/3 16:26
 **/
@Data
public class RefundDetail {

    /**
     * 退款单号
     */
    private String refundNo;

    /**
     * 退款金额
     */
    private BigDecimal amount;


    private String reason;

    /**
     * 退款状态
     */
    private Integer status;


    private String statusMsg;

    public String getStatusMsg() {
        return RefundStatus.getMessage(status);
    }

    /**
     * 申请时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime time;

    /**
     * 记录
     */
    private List<Record> records;

    /**
     * 退款信息
     */
    private List<Product> products;

    @Data
    public static class Record {

        private Integer id;

        private String message;

        private String reason;

        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime time;
    }

    @Data
    public static class Product {

        private String productName;

        private String skuName;

        private String image;
    }
}
